package PlayerManager;

import java.awt.BorderLayout;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;

import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.JPanel;

import Gui.ImagePanel;
import Main.Defines;

public class LottoCard {
	private static final int LOTTO_CHANCES_LIMIT = 6;
	private ArrayList<Chance> m_lottoChances;

	public LottoCard() {
		m_lottoChances = new ArrayList<Chance>();
		// get 6 lotto chances from playerManager's chance list
		while (m_lottoChances.size() != 6) {
			m_lottoChances.add(Defines.PLM.removePossibilityFromPool());
		}
	}

	public boolean contains(Chance val) {
		for (Chance a : m_lottoChances) {
			if (a.getFirst() == val.getFirst()
					&& a.getSecond() == val.getSecond())
				return true;
		}
		return false;

	}
	public ArrayList<Chance> getArrayList(){
		return m_lottoChances;
	}
	public String toString() {
		return new String(String.format("1:%s 2:%s 3:%s 4:%s 5:%s 6:%s",
				m_lottoChances.get(0), m_lottoChances.get(1), m_lottoChances
						.get(2), m_lottoChances.get(3), m_lottoChances.get(4),
				m_lottoChances.get(5)));
	}

}
